home *** CD-ROM | disk | FTP | other *** search
- /* memmove.c, from p.154 of Turbo C Bible */
- /* Copies a specified number of bytes from one buffer to another
- (handles overlapping source and destination. */
- #include <stdio.h>
- #include <mem.h>
- static char src[80] = "FirstSecond";
- main()
- {
- printf("Before memmove: Source = %s\n", src);
- memmove(&src[5], src, sizeof(src)); /* Copy from source to itself */
- printf("After memmove: Source = %s\n", src);
- }